
import { handleActions, createAction } from 'redux-actions';
import request from '../utils/request'
import React from 'react';

var namespace = 'global'

var state = {
    locale: 'en',
}

export default {
    // 处理异步
    effects: {
        // 在这里定义公共的接口方法
        queryData: createAction('', async (payload) => {        //根据ID获取到推荐职位列表
            return request.get('/')
        }),
    },
    // 同步更新数据
    reducer: {
        [namespace]: handleActions({
            // 修改基础数据
            [namespace + '/setState']: {
                //成功执行的函数
                next(state, action) {
                    return {
                        ...state,
                        ...action.payload,
                    };
                },
            },
        }, state),
    }
}


